//  首先开始自动播放图片
var go = setInterval("NextSwitching()",2000);
//  切换后一张图片函数
function NextSwitching() {
    var i = document.getElementById('img-biggest')
    var img_src = i.src;
    var img_char = img_src.charAt(img_src.length-5);
    var img_number = img_char - '0';
    if(img_number == 5)img_number = 1;
    else img_number++;
    img_char = img_number+'';
    i.src= '../img-liJiajian/' + img_char + '.png';
    color(Math.floor(Math.random()*6));
}
//  切换前一张图片函数
function PreviouSwitching() {
    var i = document.getElementById('img-biggest')
    var img_src = i.src;
    var img_char = img_src.charAt(img_src.length-5);
    var img_number = img_char - '0';
    if(img_number == 1)img_number = 5;
    else img_number--;
    img_char = img_number+'';
    i.src= '../img-liJiajian/' + img_char+'.png';
    color(Math.floor(Math.random()*6));
}

//图片循环函数
function loop() {
    clearInterval(go);
    go = setInterval("NextSwitching()",2000);
}
//鼠标点击小点切换的图片的函数
function PictureSwitching(a) {
    clearInterval(go);
    var i = document.getElementById('img-biggest')
    var img_char = a+'';
    i.src= '../img-liJiajian/' + img_char+'.png';
    color(Math.floor(Math.random()*6));
    setTimeout('loop()',4500);
}

//文本框颜色
function color(i) {
    var col = document.getElementById('text');
    if(i ==1)
    {
        col.style.color = 'lightblue';
    }
    if(i ==2)
    {
        col.style.color = 'moccasin';
    }
    if(i ==3)
    {
        col.style.color = 'mediumorchid';
    }
    if(i ==4)
    {
        col.style.color = 'plum';
    }
    if(i ==5)
    {
        col.style.color = '#ccffcc';
    }
}